home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 8256 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.2 KB

  1. Path: inferno.mpx.com.au!news
  2. From: Malcolm Smith <mjsmith@mpx.com.au>
  3. Newsgroups: comp.lang.pascal.misc,comp.lang.pascal.borland,comp.programming,comp.lang.misc,comp.lang.c,comp.lang.c++
  4. Subject: Re: Writing an expression evaluator
  5. Date: 16 Feb 1996 06:56:58 GMT
  6. Organization: Microplex Pty Ltd
  7. Message-ID: <4g19rq$288@inferno.mpx.com.au>
  8. References: <311FEBD8.7305@cnj.digex.net>
  9. NNTP-Posting-Host: dialup-211.mpx.com.au
  10.  
  11. Aristotle <johndc@cnj.digex.net> wrote:
  12. >
  13. > Does anyone have any tips on how to go about writing an expression 
  14. > evaluator(one complex enough to handle Trig. functions). I am writing a 
  15. > program that uses expression and I would like to have the user be able to 
  16. >  enter their own expressions and have my program implement them. Any help 
  17. >  would be appreciated. Thanks in advance!
  18. >         
  19. >                 John M. "Aristotle" De Cristofaro
  20.  
  21.  
  22. I have an expression evaluator written in C based on Polish notation.
  23.  
  24. It was primarily designed for normal mathemtical functions such as
  25. add, subtract, multiply and divide.  It does, however, manager
  26. brackets - using recursion.
  27.  
  28. It could be modified to include further functions.
  29.  
  30. Email me if you want the source code.
  31.  
  32.  
  33. Malcolm Smith
  34. mjsmith@mpx.com.au
  35.  
  36.